package com.chanyachting.emall.action.newsactivity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Newsactivity;
import com.chanyachting.emall.form.NewsActivityForm;
import com.chanyachting.emall.service.NewsActivityService;
import com.chanyachting.emall.serviceImpl.NewsActivityServiceImpl;

public class RefreshAction extends Action {

	
	//刷新新闻活动
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		
		NewsActivityForm naForm=(NewsActivityForm)form;
		
		NewsActivityService naservice=new NewsActivityServiceImpl();
		
		Newsactivity na=new Newsactivity();
		
		//复制属性
		//BeanUtils.copyProperties(na,naForm);
		
		na.setId(naForm.getId());
		
		naservice.refresh(na);
		
		return mapping.findForward("newsactivityList");
	}
	
	
	

}
